
package org.jdcenter.jndi.context.local;

import javax.naming.Context;
import javax.naming.NamingException;

import org.jdcenter.jndi.context.JDSContext;
import org.jdcenter.jndi.context.ProxyContext;

/**
 * @author miao
 * 本地Context代理
 * 
 */
public class LocalProxyContext extends ProxyContext {
    
    private static Context proxyContext = null;
       
    private int prot = 1099;
    private String subContextName = "org.jdstream.jndi.context.local.RMIJRMPContextServer";
    
    public LocalProxyContext() throws NamingException{
    	this.delegateContext = new JDSContext(rootNamespace);
    	init();
    }
    
    protected String getStubContextName(){
    	return subContextName;
    }
    
    public static Context getContext() throws NamingException{
    	if(proxyContext == null){
    		proxyContext = new LocalProxyContext();
    	}
    	return proxyContext;
    }
    

}
